﻿@model Products
@section ToolBar{
    <div class="r-c-tool">
        <a href="javascript:location.reload();" class="l-btn fa fa-refresh"></a>
        <a href="javascript:void(0);" class="l-btn fa fa-search"></a>
    </div>
    <div class="r-c-list">
        <a class="l-btn cur"  href="#">全部库存</a>
    </div>
}
<div class="l-m-table">
    <table>
        <tr class="bgc3">
            <th>图片</th>
            <th>商品编号</th>
            <th>商品名称</th>
            <th>批号</th>
            <th>库位</th>
            <th>合格</th>
            <th>可用数量</th>
            <th>锁定数量</th>
            <th>总数</th>
        </tr>
        @if (Model == null || Model.Items.Count <= 0)
        {
            <tr>
                <td colspan="11" class="t-c c0">暂无记录</td>
            </tr>
        }
        @foreach (Product p in Model.Items)
        {
            int row = p.StoreProducts.Items.Count + 1;
            <tr>
                <td rowspan="@row"><img src="@p.Image60" /></td>
                <td rowspan="@row">@Html.LActionLink(p.ProductNo, "Detail", "Product", new { id = p.ProductId })</td>
                <td rowspan="@row">@Html.LActionLink(p.ProductName, "Detail", "Product", new { id = p.ProductId })</td>
                @if (p.StoreProducts.Items.Count <= 0)
                {
                    <td class="bd-left">-</td>
                    <td>-</td>
                    <td>-</td>
                    <td>0.00</td>
                    <td>0.00</td>
                    <td>0.00</td>
                }
            </tr>
            foreach (StoreProduct sp in p.StoreProducts.Items)
            {
                <tr>
                    <td class="bd-left">@sp.LotNo</td>
                    <td>@sp.Store.StoreName</td>
                    <td>@sp.QualityStyleId.GetEnumDescription()</td>
                    <td>@sp.UseableQuantity.QuantityFormat()</td>
                    <td>@sp.LockQuantity.QuantityFormat()</td>
                    <td>@sp.Quantity.QuantityFormat()</td>
                </tr>
            }
        }
    </table>
</div>
@section Pager{
    @Html.Pager("Index", "Product", Model.TotalCount, (int)ViewBag.PageIndex, 20)
}